<ion-view view-title="任务详情">
  <ion-content>
    <ion-refresher on-refresh="doRefresh()"
                   pulling-text="下拉刷新..."
                   refreshing-text="拼命加载中..."
                   refreshing-icon="ion-loading-b">

    </ion-refresher>
      <div class="list card" href="#">
        <div class="item">
          <h2>{{task.get('area_name')}}-
            <span ng-if="(task.get('type') != 9)" style="color: red;">{{task.get('type') | orderTypeName}}</span>
            <span ng-if="(task.get('type') === 9)">商家外卖</span>
            <span ng-bind-html="task.get('code') | colorString"> </span>
            <a class="float-right"
               style=" color: orange"
               ng-click="bookTime(event,task.get('code'))"
               ng-show="task.get('status') === 8000 || task.get('status') === 7000">预约</a>
          </h2>
        </div>
        <div class="item item-body">
          <p ng-if="(task.get('expresstype') == '定时送达')">
            <span style="color: red;">定时送达订单</span>
            <span style="color: red;">用户预约时间：{{task.get('deliveryTime')*1000 | date : 'yyyy-MM-dd HH:mm'}}</span>
          </p>
          <p>
            <i class="icon ion-ios-home" style="font-size: x-large;color: orange;"></i>
            {{task.get('to_address')}}
          </p>
          <p>
            <i class="icon ion-ios-people" style="font-size: x-large;color: orange;"></i>
            {{task.get('to_name')}}
            <a href="tel:{{task.get('to_tel')}}">{{task.get('to_tel')}}</a>
            <a href="tel:{{task.get('to_tel')}}" class="icon ion-ios-telephone"></a>
          </p>
          <p>
            <i class="icon ion-bookmark" style="font-size: x-large;color: orange;"></i>
            {{task.get('remark') || ' /'}}
          </p>
          <p>
            <i class="icon ion-social-yen" style="font-size: x-large;color: orange;"></i>
            {{task.get('pay_way') | payway}} ({{task.get('final_amount')}}元)
          </p>
          <p>
            <i class="icon ion-arrow-graph-up-right" style="font-size: x-large;color: orange;"></i>
            {{task.get('status') |  orderState }}
          </p>
          <p ng-if="task.get('book_time') !=undefined">
            <i class="icon ion-ios-time" style="font-size: x-large;color: orange;"></i>
            {{task.get('book_time') | date : 'yyyy-MM-dd HH:mm:ss'}}
          </p>
        </div>

        <div class="row ">
          <!-- mymission.orderInfo.get('status') === 7000-->
          <div ng-if="(task.get('type') != 11 && task.get('type') != 12)">
            <div class="col" ng-show="task.get('status') === 8000 || task.get('status') === 7000">
              <button class="button button-assertive button-small button-block" ng-click="finishExpress(event,task.get('code'),task)">
                <i class="icon ion-android-walk "></i>
                <b>完成派送</b>
              </button>
            </div>
          </div>
          <div class="col" ng-show="task.get('status') === 8000 || task.get('status') === 7000">
            <button class="button button-calm button-small button-block" ng-click="reject(event,task.get('code'))">
              <i class="icon ion-sad-outline"></i>
              <b>拒 收</b>
            </button>
          </div>
        </div>
      </div>
  </ion-content>
</ion-view>
